"""
通义千问VL模型可以根据您传入的图片来进行回答。
"""
import os
from openai import OpenAI


client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    base_url="https://dashscope.aliyuncs.com/compatible-mode/v1"
)

completion = client.chat.completions.create(
    model="qwen-vl-max-latest",
    messages=[
        {"role": "user", "content": [
            {"type": "image_url", "image_url": {"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20241022/emyrja/dog_and_girl.jpeg"}},
            {"type": "text", "text": "这是什么？"}
        ]}
    ]
)

print(completion.choices[0].message.content)